// TOWN DIALOGUE SCRIPT
//    Town 8: Sharimik

begintalkscript;

variables;

short i,j,k,r1,choice;

// Mayor Knight

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Mayor Knight";
	text1 = "This man watches you from behind his desk. His clothes are very ostentatious, and his mayor's sash is made of thick, purple velvet. His eyes are cold and emotionless.";
	text2 = "He raises a hand and runs a finger along his gold circlet. _I am Mayor Knight. I control Sharimik. I lead us on the safe path. This to my office, outsider._";
	text3 = "_We do not welcome strangers here. This is a time of war. You will need to behave and make yourself useful._";
	text5 = "Mayor Knight frowns. The way he looks at you, you suspect that he knows you're from Avernum. Fortunately, he's desperate enough to deal with you, though. _What else do you need, outsider? Be quick. I have a whole city to keep on the safe path._";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(8,1) == 1;
	question = "_Mayor Bernathy told me to come see you._";
	text1 = "Mayor Knight is skeptical, so you tell the tale of your adventures on the Isle of Bigail. _I let you into my city because I heard rumors of you. Perhaps some of those rumors are true._";
	text3 = "_I will spare you some of my precious time. Sharimik is under vicious assault. I hate to admit it to an outsider, but ... We need help._";
	code =
		sf(8,1,2);
		toggle_quest(104,10);
		award_party_xp(100,14);
	break;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_How fares Sharimik?_";
	text1 = "He looks somber. _Well, it's complicated, but at the heart of it, I am trying to maintain control._";
	text3 = "He looks somber. _Better than it was, but there is still chaos everywhere. At the heart of it, I am trying to maintain control._";
	action = DEP_ON_SDF 307 8 0;

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Why is control so difficult?_";
	text1 = "_Attacks come at us from all sides. The Empire has abandoned us. I guide my people upon the only safe path left to us._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_Who is attacking you?_";
	text1 = "_We have foes, both outside and inside. The troglos come at us from without, and subversives cause rot from within._";
	text3 = "_We have foes, both outside and inside. The troglos came at us from without, and subversives cause rot from within. The troglos attack less now, but that only makes us notice the other dangers more._";
	action = DEP_ON_SDF 307 8 0;

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_What subversives?_";
	text1 = "He looks disturbed. _I'm afraid you are not authorized to have that information. My apologies._";
	text3 = "He looks nervous. _I'm afraid you are not authorized to have that information. My apologies._ Something about the tone of his voice makes you think that you are one of the _subversives._";
	action = DEP_ON_SDF 307 8 0;

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_What sort of help are you expecting from the Empire?_";
	text1 = "_The Empire has not sent us guidance, supplies, or reinforcements for months and months. We have to look after ourselves. They have shut us off since the disaster at Tinraya._";

begintalknode;
	state = 1;
	nextstate = 5;
	question = "_What is the 'safe path'?_";
	text1 = "_Control! The Empire rules our world through control, and we can keep Karnold Province safe through control! Our discipline will help us defeat the troglos!_";
	text2 = "_In fact, that is why you were allowed to enter Sharimik._";

begintalknode;
	state = 5;
	nextstate = 6;
	condition = gf(307,8) == 0;
	question = "_So if I hadn't fought monsters down south, we would not be here?_";
	text1 = "_Essentially. Word has spread of the pale travelers who helped end a plague of monsters to the south. I, therefore, let you come here in the hope that you could be convinced to undertake a quest for us._";

begintalknode;
	state = 6;
	nextstate = 7;
	question = "_Tell me more about this quest._";
	code =
		run_hardcode(141);
	break;

begintalknode;
	state = 7;
	nextstate = -1;
	question = "_What's my reward for helping you with the troglodytes?_";
	text1 = "_Wealth, of course. Cash consideration. Plus, we have some magical knowledge which I think you will greatly appreciate. But only if you help us._";

begintalknode;
	state = 7;
	nextstate = 8;
	condition = gf(10,0) == 1;
	question = "_What problem is that?_";
	text1 = "_Sharimik is ruled by a triad right now. Empire rules bind us still. Before you can go on a mission for us, you need to get approval from Garrison Commander Corie and Internal Affairs Supervisor Levin._";
	text2 = "_Go ask them about this mission. Convince them to allow you to undertake it, and I will assist you._";

begintalknode;
	state = 8;
	nextstate = -1;
	question = "_I have not heard of Empire cities having triads before._";
	text1 = "_Before the border was sealed, Empress Prazac declared Sharimik a Battle Capital. This gives us more power and more responsibility. Krizsan and Shayder are, in the eyes of the Empire, mere settlements. This fortress is held to a proper standard._";

begintalknode;
	state = 8;
	nextstate = -1;
	question = "_Where is Commander Corie?_";
	text1 = "_She is in the barracks, at the north end of the city._";

begintalknode;
	state = 8;
	nextstate = -1;
	question = "_Where is Supervisor Levin?_";
	text1 = "_A superb gentleman. My right-hand man. He's just next door._";

begintalknode;
	state = 7;
	nextstate = -1;
	question = "_What does the scroll say?_";
	text1 = "_The scroll grants free passage into Castle Troglo to the bearer. When you get the required permission and accept the mission, I will give you the scroll._";

begintalknode;
	state = 1;
	nextstate = 7;
	condition = gf(307,8) == 0 && gf(10,0) == 0;
	question = "_I am looking for employment._";
	code =
		run_hardcode(141);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(307,8) == 0 && gf(10,0) > 0 && gf(10,0) < 3;
	question = "_What should I do now?_";
	code =
		run_hardcode(141);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(28,8) >= 7;
	question = "_The Troglodyte King gave me a message for you._";
	code =
		run_hardcode(141);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(11,0) >= 1 && gf(10,9) >= 1 && gf(10,0) == 1;
	question = "_I have received permission from both Corie and Levin._";
	code =
		run_hardcode(141);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(307,8) == 0;
	question = "_Why was I allowed into Sharimik?_";
	text1 = "_We both know that you are, well, unusual. We know you are from elsewhere. But these are strange times. We were not able to deal with the troglodytes. But we thought you might._";

begintalknode;
	state = 1;
	nextstate = 40;
	condition = gf(8,16) == 0;
	question = "_You say you control Sharimik? That's an odd word to use._";
	text1 = "_If you saw how much disloyalty I had to deal with, how much fear, how close my people are to panic, you would use that word too. Every day, it seems like someone else is being disloyal. And disloyalty must be dealt with harshly._";
	text2 = "_We have no room for rebellion now, what with the troglos at the gates._";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = gf(8,16) == 0;
	question = "_That is reasonable. Strict discipline is necessary in a time of war._";
	text1 = "_Yes, yes. It is so rare to hear such sensible words. My people could learn from you, outsider._";
	action = SET_SDF 8 16 1;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = gf(8,16) == 0;
	question = "_That might be reasonable, but only when you act with justice._";
	text1 = "He frowns. _Justice? I am in charge here. I am justice. You would be wise to remember that. You are here because I gave permission, and for no other reason._";
	action = SET_SDF 8 16 1;


begintalknode;
	state = 1;
	nextstate = 10;
	condition = gf(10,0) > 2;
	question = "_Is there anything else I can do for you?_";
	text1 = "_You should go. Now that the troglos have withdrawn, I must regain tight control of this city. Your presence is only going to ... unsettle things._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(9,2) <= 1;
	question = "_Is there any advice you can give me?_";
	text1 = "_If you want to keep aiding your fellow humans, there is definitely a place you can go to: Lorelei. A city to the north. They have been assaulted by waves of humanoids, even more deadly than the troglos._";
	text2 = "_I think Commander Bruskrud is still stationed there. Good woman. Tell her that I sent you. You will be welcomed, if the name of Knight is still respected there._";
	code =
		sf(9,2,1);
		toggle_quest(105,1);
	break;
	
// Captain Corie

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Commander Corie";
	text1 = "You've been on the surface long enough to recognize the insignia of a Commander, a very high post in the army of the Empire. The highest officer of Sharimik watches you skeptically.";
	text2 = "She seems unwilling to give you some of her valuable time, but she is resigned to it. _So the famed adventurer stops by. I am Captain Corie._";
	text5 = "Commander Corie stares at you. Every moment of her life you absorb is a clear source of resentment.";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_What are your responsibilities?_";
	text1 = "_I run the Sharimik garrison, outsider. Quite a job. I also help Mayor Knight as best I can._";

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_Are a lot of troops stationed here?_";
	text1 = "_Sharimik has been, for some time, the main military depot for southern Valorim. I'm in charge of looking after it. Quite the responsibility._";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_How do you help Mayor Knight?_";
	text1 = "_He is in charge of anything in Sharimik that isn't military. A competent administrator, although I am concerned about his inability to get anyone to go on this mission he's been talking about._";
	text3 = "_He is in charge of anything in Sharimik that isn't military. A competent administrator, although he had to resort to asking for your help for a job we should have been able to handle ourselves._";
	action = DEP_ON_SDF 10 0 2;

begintalknode;
	state = 31;
	nextstate = 32;
	condition = gf(10,0) >= 1 && gf(11,0) <= 0;
	question = "_What mission?_";
	code =
		run_hardcode(142);
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_What is the Ritual of Sanctification?_";
	text1 = "_All that holy mumbo jumbo is beyond me. I haven't the foggiest idea how to destroy an evil altar. I'll tell you who might, though. Talk to Nydia. She's in Softport. Tell her my name. She served with me once._";
	text2 = "_If she knows anything about how to destroy the troglo altar, she'll tell you. And that's the last help you'll get from me. I don't spoon-feed my warriors._";
	action = SET_SDF 8 11 1;

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_Do you know anything about this troglodyte altar?_";
	text1 = "_It's at the end of a long valley in the mountains east of Angel's Rest. Troglos use altars to magically energize themselves. They're big, magically charged things, and destroying one of them would be a great victory._";

begintalknode;
	state = 29;
	nextstate = 32;
	condition = gf(10,0) >= 1 && gf(11,0) <= 0;
	question = "_Mayor Knight says that I need your permission to be given the troglodyte scroll for delivery._";
	code =
		run_hardcode(142);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(101,9) >= 1 && gf(8,12) >= 1 && gf(11,0) == 0;
	question = "_I've destroyed that giant altar for you._";
	code =
		run_hardcode(142);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_The guards didn't want to allow me entry to the city. Why?_";
	text1 = "_It's delicate to talk about. Your pale complexion is worrying. But Mayor Knight thinks you can help us. I think he might know something I don't. Or, more likely, he is a fool. We will see._";

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(10,0) == 0;
	question = "_Are you looking for adventurers to perform a mission?_";
	text1 = "She laughs. _Yes, here's a mission. Fight your way to somewhere else. Quit wasting my time._";
	action = END_TALK;

// Levin

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "Levin";
	text1 = "The man behind this desk looks eerily spiderlike. He sizes you up with beady eyes. _I'm Internal Affairs Supervisor Levin._";
	text5 = "Levin watches you with his beady eyes. Despite your efforts, you fail to recognize on his face an identifiable human emotion. The people of the sands are a hard lot.";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_Impressive job title. What does it mean?_";
	text1 = "He grins and twitches slightly. _Many tasks fall to me. I maintain loyalty. I am the chief jobs dispatcher. I am mapmaking coordinator. And I assist Mayor Knight whenever possible._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_Exactly how do you 'maintain loyalty'?_";
	text1 = "His mouth twitches in disapproval. _I'm sorry. You are not allowed to know about that._ He thinks. _But I'm sure you can come up with a few guesses._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_Do you have any jobs for me?_";
	text1 = "_You have not yet been forgiven for failing to follow through on the earlier job you got here. It will be some time before you will be trusted with another task._";
	text3 = "_Consult the boards outside. You can earn your keep there._";
	action = END_TALK;
	code =
		if (gf(295,2) == 0)
			rs(1);
			else rs(3);
	break;

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_Mapmaking Coordinator. Sounds useful._";
	text1 = "He gives you a thin lipped smile. _I tell official, Empire-sanctioned mapmakers in the area what areas need mapmaking, and compile the fruits of their labors._";
	text2 = "_Would you like to purchase a map of Karnold Province? Only fifty coins._";

begintalknode;
	state = 59;
	nextstate = 57;
	condition = coins_amount() >= 50;
	question = "_I want to buy a map._ Pay 50 coins.";
	text1 = "You pay the fee and receive a map. Your world map has now expanded.";
	text3 = "You already have this map.";
	code =
		if (gf(309,20) > 0)
			rs(1);
			else {
				rs(3);
				sf(309,20,1);
				change_coins(-50);
				}
	break;
	
begintalknode;
	state = 59;
	nextstate = 57;
	condition = 1;
	question = "_No, thank you._";
	text1 = "_What, then?_";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_How do you help the Mayor?_";
	text1 = "_Mayor Knight is a wise and strong-willed man, and I am proud to be at his right hand. By the way, I understand he has been looking for someone to undertake a mission._";
	text3 = "_Mayor Knight is a wise and strong-willed man, and I am proud to be at his right hand. Sometimes, he needs, say, assistance from outside. But normally sort of competent._";
	action = DEP_ON_SDF 10 0 0;

begintalknode;
	state = 57;
	nextstate = -1;
	condition = gf(10,0) == 1 && gf(11,9) == 0;
	question = "_I need your permission to go on Mayor Knight's quest._";
	text1 = "_So you want permission to go on a mission, eh? Well, it's no problem. However, there's a lot of paperwork that I'll need to fill out first. And there's a filing fee for those papers._";
	text2 = "_Give me 1000 coins, and I'll give you permission. When you have the money, I'll be ready to help you._";
	action = SET_SDF 11 9 1;

begintalknode;
	state = 57;
	nextstate = -1;
	condition = gf(11,9) >= 1 && gf(10,9) <= 0;
	question = "_I have the payment for your permission._ (Pay 1000 coins.)";
	code =
		run_hardcode(143);
	break;

begintalknode;
	state = 57;
	nextstate = 60;
	condition = gf(11,9) >= 1 && gf(10,9) == 0;
	question = "_I am willing to risk my life to help your town. You had better help me._";
	code =
		run_hardcode(30);
	break;
	
begintalknode;
	state = 60;
	nextstate = 57;
	condition = gf(8,3) == 0;
	question = "_That sounds arrogant._";
	text1 = "_Well, prove me wrong. The walls hold. The troglos cannot enter. I feel no need to forfeit my customary fee._";
	
begintalknode;
	state = 60;
	nextstate = 57;
	condition = gf(8,3) > 0;
	question = "_What about the troglos burrowing in through your sewers?_";
	text1 = "Levin looks worried. He hadn't yet been told of the infiltrators in the storeroom. Now he is concerned.";
	text2 = "_He finally says, _In this very limited case, I can forfeit my fee._ He fills out a slip of paper and gives it to an assistant to take to Mayor Knight. _You have my permission._";
	code =
		if (gf(10,9) > 0)
			rs(2);
			else sf(10,9,1);
	break;

begintalknode;
	state = 57;
	nextstate = -1;
	condition = 1;
	question = "_That is all I need._";
	text1 = "_All right, then. You may go. Obey our laws. We are not as lax as the southern lands._";
	action = END_TALK;

// SANDRA in auxdlg

// Ballard

begintalknode;
	tag = 120;
	state = -1;
	nextstate = 113;
	question = "Ballard";
	text1 = "The man behind the counter is busily polishing some delicate tools. _I'm Ballard._ There are lots of tools and little metal devices in this shop.";
	text5 = "Ballard smiles and works. _Anything else I can do for you, friend?_";
	action = INTRO;

begintalknode;
	state = 113;
	nextstate = 114;
	question = "_What sort of shop is this?_";
	text1 = "_I make tools. You can purchase them. And it makes me very happy._ He grins, in order to show you how happy he is.";

begintalknode;
	state = 113;
	nextstate = -1;
	question = "_Can I buy some of your items?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Ballard's Tools","Ballard is happy. Eerily so. His adventuring tools are decent quality.",74,3,3);
	break;

begintalknode;
	state = 114;
	nextstate = 115;
	question = "_So what are you so happy about?_";
	text1 = "_Happy? I am incredibly happy. I could not be happier with the rulership of our town. Yes, I am inspired._";

begintalknode;
	state = 115;
	nextstate = -1;
	question = "_Yeah, I can see you're thrilled._";
	text1 = "He continues to smile, but his eyes watch you carefully. He speaks clearly and deliberately. _Yes. I could not be more happy with the leadership of our mighty city. I am very content and feel safe. All right?_";
	text2 = "You suspect that people who express differing opinions are subjected to unpleasant fates.";


begintalknode;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "_I would like to sell something._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_I'm happy that you're satisfied. I'll be happy when you return._";
	action = END_TALK;
	
// Isaac

begintalknode;
	tag = 240;
	state = -1;
	nextstate = 401;
	question = "Isaac";
	text1 = "You meet Sharimik's resident fletcher. He is putting the final polish on a wicked-looking barbed arrow. He nods as you enter, not looking up. _I'm Isaac. Welcome._";
	text5 = "Isaac looks up from his work. It's a beautiful set of matched arrows. He deigns to pay attention to you for a little bit. _Any interest in my wares?_";
	action = INTRO;

begintalknode;
	state = 401;
	nextstate = 402;
	question = "_What sort of shop is this?_";
	text1 = "_You can purchase missile weapons from me. Quality goods, I assure you. A little trading will distract me from my worries._";

begintalknode;
	state = 401;
	nextstate = -1;
	question = "_Can I purchase some weaponry?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Isaac the Fletcher","Isaac mainly makes arrows and bolts. However, he has a variety of airborne weaponry for sale. Some of the javelins look like they've been used once or twice already.",75,2,3);
	break;

begintalknode;
	state = 402;
	nextstate = 403;
	question = "_What worries you?_";
	text1 = "He looks around to make sure nobody is listening in. _I can tell you about this, but nobody else. We've all heard how brave you are, and it's best not to let our leaders hear us express skepticism._";
	text2 = "_I am concerned about my child._";

begintalknode;
	state = 403;
	nextstate = -1;
	question = "_Tell me about your leaders._";
	text1 = "He looks grim. _In the absence of the Empire's influence, Mayor Knight grows more controlling every day. Nobody has been punished for saying the wrong thing yet, but some of us fear it is only a matter of time._";

begintalknode;
	state = 403;
	nextstate = -1;
	question = "_Why are you concerned about your child?_";
	text1 = "_We are attacked by troglodytes all the time. I'm planning to send my daughter, Kelly, to Softport, a much safer place to be. I will miss her so, though._ He sighs. _Thank you for letting me unburden my soul._";
	text3 = "_I sent my daughter, Kelly, to Softport recently to keep her safe from the troglos. I get messages from her sometimes, but I worry about her terribly, and miss her more._ He sighs. _Thank you for letting me unburden my soul._";
	code =
		if (day_reached(95,2))
			remove_string(1);
			else remove_string(3);
	break;

begintalknode;
	state = 401;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "He looks down to his arrows and resumes his work without a word.";
	action = END_TALK;
	
// Ellyn

begintalknode;
	tag = 260;
	state = -1;
	nextstate = 429;
	question = "Ellyn";
	text1 = "There is a serene-looking woman standing before the altar. She is thinking peaceful thoughts. You interrupt her peaceful reverie by clearing your throat.";
	text2 = "She turns, startled. _Oh, hello. I am Mother Ellyn._";
	text5 = "Mother Ellyn speaks with you, slowly and serenely. _What else troubles you, my child?_";
	action = INTRO;

begintalknode;
	state = 429;
	nextstate = 430;
	question = "_Greetings. You seem very peaceful._";
	text1 = "_Oh yes, I am the priestess of the Shrine of Happy Thoughts. May I provide assistance?_";

begintalknode;
	state = 430;
	nextstate = -1;
	question = "_That depends, what sort of assistance can you provide us?_";
	text1 = "_I can teach a variety of spells. Also, I am a skilled healer._";

begintalknode;
	state = 430;
	nextstate = 431;
	question = "_How did you come to be a priestess of the Shrine of Happy Thoughts?_";
	text1 = "She looks slightly embarrassed. _Well, I wanted to start a faith to guide people and make their lives better. Unfortunately, I couldn't come up with a good guiding principle. So I improvised._";

begintalknode;
	state = 431;
	nextstate = -1;
	question = "_What principle did you end up choosing?_";
	text1 = "_I made the Shrine of Happy Thoughts, based on the principle that, well, things would be a lot better if people were kind and just tried to be nice to each other for a change._";
	text2 = "_Of course, it hasn't been popular at all. But you can't blame me for trying._";

begintalknode;
	state = 429;
	nextstate = -1;
	question = "_We'd like to learn some priest spells._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Ellyn's Spells","Ellyn is an accomplished healer. She is willing to, for a donation, share some of her valuable techniques with you.",76,2,3);
	break;

begintalknode;
	state = 429;
	nextstate = 432;
	question = "_I need the services of a skilled healer._";
	text1 = "She inspects you. _You seem to be in good health. This makes me happy._";

begintalknode;
	state = 432;
	nextstate = -1;
	condition = has_spec_item(66) > 0;
	question = "_I am afflicted with a horrible curse. Can you heal me?_";
	text1 = "_You are? Really? That's so sad. I wish I could help._";
	text2 = "She thinks. _I've heard that there are very good healers among the Anama. Perhaps they can purge you._";

begintalknode;
	state = 429;
	nextstate = -1;
	condition = 1;
	question = "_I need to go now._";
	text1 = "_I wish you peace and tranquility._";
	action = END_TALK;	
	
// Spragins 

begintalknode;
	tag = 280;
	state = -1;
	nextstate = 457;
	question = "Spragins";
	text1 = "You meet a wizened old man with a carefully trimmed white beard. He sets down a thick, leather bound book to speak with you. He's pale enough to have come from Avernum, though you doubt he actually did.";
	text2 = "_Welcome. I am known here as Spragins. And magic. I do magic._ He occasionally looks at the west door. Then he pretends he doesn't care about the west door. Then he looks at the west door again.";
	text5 = "Spragins looks longingly at his stack of unread books. _What else do you want to know? My knowledge is deep, but my time is valuable._";
	action = INTRO;

begintalknode;
	state = 457;
	nextstate = 458;
	question = "_What services do you provide?_";
	text1 = "He takes a deep breath and thinks it over. _Well, I do magic, I suppose. That seems to be a good overall description of my activities._";

begintalknode;
	state = 458;
	nextstate = 459;
	question = "_That's a bit vague. Can you be more specific?_";
	text1 = "_Yes, magic does seem to be a good catch-all sort of term for my activities. For example, I read about magic things, and then I think about them. Or I teach spells to passing mages, for a price. And, of course, I do research._";
	text2 = "_That would seem to be an excellent summary of the current activities I am referring to when using the general term 'magic'._";

begintalknode;
	state = 459;
	nextstate = -1;
	question = "_Tell me of your research._";
	text1 = "He sighs. _I am working on the puzzle of the ages ... a way to rediscover the lost art of far sight. Once, wizards could close their eyes and see the lands for miles around. Then the ability vanished._";
	text2 = "_Many have cried for such a wondrous thing, and yet it is slow in coming. Perhaps one day..._ His voice trails off.";

begintalknode;
	state = 457;
	nextstate = -1;
	question = "_We're interested in learning spells._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Spragin's Spells","Spragin's spells are not the strongest possible, but they are quite powerful. He explains the rituals with a strong, confident voice.",77,4,3);
	break;

begintalknode;
	state = 457;
	nextstate = 460;
	condition = gf(8,15) == 0;
	question = "_What is past the west door?_";
	text1 = "_What? That? There is? I ... Research. Just research. I'm trying to do something. Something that Grove does. But I will do it better._";

begintalknode;
	state = 460;
	nextstate = -1;
	condition = gf(8,15) == 0 && gf(307,8) == 0;
	question = "Can I see it?";
	text1 = "_No. It's far too dangerous. I would not allow you to hurt yourself. Maybe ... If you give us a reason to be grateful to you. And you give me time to keep it from killing you._";

begintalknode;
	state = 460;
	nextstate = -1;
	condition = gf(8,15) == 0 && gf(307,8) > 0;
	question = "Can I see it?";
	text1 = "_Well ... I've heard that you did help us. With the troglos, I mean. You can look at it. I think I've duplicated Grove's device, but I'm not sure how it works. Maybe you can get some value out of it._";
	text2 = "He makes sure the west door is unlocked.";
	code =
		sf(8,15,1);
		sf(8,26,1);
	break;
	
begintalknode;
	state = 457;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "Spragins nods. _All right._ He picks up his book.";
	action = END_TALK;

// Grassi

begintalknode;
	tag = 300;
	state = -1;
	nextstate = 485;
	question = "Grassi";
	text1 = "You stumble over a small, middle-aged man. He is sitting concealed behind a clump of trees. He looks panicked at first, but he relaxes after he sees who you are. _I'm Grassi. Move in, quick! Don't let anyone see you!_";
	text5 = "Grassi tries to squeeze himself farther back into his hiding space. _Speak quickly. You'll call attention to me!_";
	action = INTRO;

begintalknode;
	state = 485;
	nextstate = 490;
	question = "(Try to hide with Grassi.)";
	text1 = "You soon find that his hiding space within a tight clump of trees doesn't have room for you. _Back away,_ he hisses. _Just look away and pretend you don't see me. Or they'll get me!_";

begintalknode;
	state = 490;
	nextstate = -1;
	question = "_How do you know I won't hurt you?_";
	text1 = "_I know. I've heard about you. We all have. You may be a threat, but not to me._";


begintalknode;
	state = 485;
	nextstate = 486;
	question = "_Why are you hiding?_";
	text1 = "_I'm an alchemist,_ he whispers. _I study alchemy. Be careful!_ He motions for you to join him behind the trees. _You can't be too careful!_";

begintalknode;
	state = 486;
	nextstate = 489;
	question = "_What do I need to be careful of?_";
	text1 = "He looks somber and shrinks further back into the bushes. _Well, there's the troglodytes, of course. What's worse, there's Mayor Knight._";

begintalknode;
	state = 489;
	nextstate = -1;
	question = "_What's up with Mayor Knight?_";
	text1 = "_We've not heard anything from the Empire for months! Knight is using the opportunity to take total control of the town. He and his flunkies punish anyone who questions them!_";
	text2 = "_Can you blame me for just staying back here, out of the way?_";

begintalknode;
	state = 489;
	nextstate = -1;
	question = "_What do you know about the troglodyte problem?_";
	text1 = "_Troglodyte patrols hit town all the time. Their mages hit us with fire and cast spells so their fighters can fly in and cause all sorts of havoc! That's why I just hide. Wouldn't you?_";
	text3 = "_Well, they say that the troglodytes aren't a problem anymore, now that they're fighting the giants. But they still attack here sometimes! Who can blame me for being nervous?_";
	action = DEP_ON_SDF 307 8 0;

begintalknode;
	state = 486;
	nextstate = 487;
	question = "_What kind of alchemy do you do?_";
	text1 = "_The hard kind. Potions. It's hard to do any new research when concealed back here, I admit, but you can't be too careful. It's a pity, too. I had come up with some excellent recipes._";

begintalknode;
	state = 487;
	nextstate = 485;
	question = "_What recipes do you know?_";
	text1 = "_I am the master of the elixirs,_ he whispers quickly. _Yes, indeed. I can make all of the more intense brews. But I don't do it now, because it would mean being seen._";
	text2 = "_You can give me ingredients. Give a graymold, and other herbs. I can slip off and make the elixirs for you. Let me know._";
	code =
		sf(8,21,1);
	break;

begintalknode;
	state = 485;
	nextstate = -1;
	condition = gf(8,21) > 0 && party_has_item(292) == 0;
	question = "_Can you make a potion for me?_";
	text1 = "He looks at your herbs. _You need graymold. You don't have graymold. I can't help you._";

begintalknode;
	state = 485;
	nextstate = 491;
	condition = gf(8,21) > 0 && party_has_item(292) ;
	question = "_Can you make a potion for me?_";
	text1 = "He looks at your herbs. _You have graymold. I can combine the graymold with other herbs to make other potions._";
	
begintalknode;
	state = 491;
	condition = num_of_item(289) > 0 && num_of_item(292) > 0;
	question = "_I would like a healing elixir._ (Give healing herb and graymold.)";
	text1 = "You give him the herbs. He slips off into the trees. You wait for a while. Eventually, he returns with a gourd. _This has your elixir in it._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_num_of_item(289,1);
		take_num_of_item(292,1);
		reward_give(226);
		play_sound(22);
	break;
	
begintalknode;
	state = 491;
	condition = num_of_item(289) > 0 && num_of_item(292) > 0;
	question = "_I would like a curing elixir._ (Give healing herb and graymold.)";
	text1 = "You give him the herbs. He slips off into the trees. You wait for a while. Eventually, he returns with a gourd. _This has your elixir in it._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_num_of_item(289,1);
		take_num_of_item(292,1);
		reward_give(227);
		play_sound(22);
	break;
	
begintalknode;
	state = 491;
	condition = num_of_item(289) > 0 && num_of_item(290) > 0 && num_of_item(291) > 0 && num_of_item(292) > 0;
	question = "_I would like an armor elixir._ (Give healing, spiritual, and energetic herbs and graymold.)";
	text1 = "You give him the herbs. He slips off into the trees. You wait for a while. Eventually, he returns with a gourd. _This has your elixir in it._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_num_of_item(289,1);
		take_num_of_item(290,1);
		take_num_of_item(290,1);
		take_num_of_item(292,1);
		reward_give(230);
		play_sound(22);
	break;

begintalknode;
	state = 491;
	nextstate = -1;
	condition = 1;
	question = "I don't need any elixirs.";
	text1 = "_Oh. Then you should go. I can't be seen helping an outsider. Go. Go! Shoo!_";
	action = END_TALK;

// Grove

begintalknode;
	tag = 440;
	state = -1;
	nextstate = 801;
	question = "Grove";
	text1 = "The man behind the counter is not your ordinary, muscle-bound blacksmith. Instead, he's a small, bland-looking mage. He's holding a steel broadsword and examining it with a practiced eye. The man looks up at you. _Welcome. I am known as Grove._";
	text5 = "As he speaks with you, Grove mumbles quiet words and runs his finger up and down the blade he is holding. You notice the metal glows briefly where he touches it.";
	action = INTRO;

begintalknode;
	state = 801;
	nextstate = 802;
	question = "_Is this a blacksmith shop?_";
	text1 = "_Well yes, I have a variety of high quality weapons available. You can sell me your excess goods if you wish. But my customers most value me for my magical skills._";

begintalknode;
	state = 802;
	nextstate = 803;
	question = "_What sort of magical skills?_";
	text1 = "_I believe that one day all blacksmithing will not be done with crude bashing by hammers, but with spells. Magic is a very versatile and beneficial tool, no matter what the Anama say._";
	text2 = "_In fact, for a fee, my marvelous pad can augment your weapons. It is quite an invention, though its use is very draining. It can imbue your items with magical properties. Interesting, yes?_";

begintalknode;
	state = 803;
	nextstate = -1;
	question = "_How can you improve my items? What do you do?_";
	text1 = "_Well, you place something you wear or wield into the box._ He points to the pad in the corner. _You pull the lever. And poof. Sadly, the effects are currently, well, unpredictable._";
	text2 = "_But always good!_ He hastens to add.";

begintalknode;
	state = 801;
	nextstate = -1;
	question = "_Can I do some trading?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Grove's Weaponry","Despite his obvious magical skills, most of the weaponry Grove sells are stubbornly non-magical. And not cheap, either.",78,4,3);
	break;

begintalknode;
	state = 803;
	nextstate = -1;
	question = "_What do you think of the Anama?_";
	text1 = "He shakes his head in disgust. _I don't speak of them any more than I have to._";
	text3 = "He takes note of your Anama rings and smiles diplomatically. _I am sure they have their place. Somewhere._";
	code =
		if (has_spec_item(40) == 0)
			remove_string(3);
			else remove_string(1);
	break;

begintalknode;
	state = 803;
	nextstate = 804;
	question = "_Yes, I'm interested in having my weapons augmented._";
	text1 = "He looks over your weapons. _Excellent! Of course, it is difficult keeping the pad charged, so I require a fee for my help. One thousand coins to use it until its power is drained. Are you interested?_";
	text3 = "_You have paid for the use of the charging device. You should be able to use it two or three times before its energy is gone._";
	action = DEP_ON_SDF 8 17 0;

begintalknode;
	state = 804;
	nextstate = -1;
	condition = gf(8,17) == 0; 
	question = "_I will pay for augmentation._ (Pay 1000 coins.)";
	text1 = "_Excellent!_ He takes the money. _Place a non-blessed item which can be wielded or worn into the box. Pull the lever, and poof! Something good will happen!_";
	text3 = "_I am sorry, but you do not have the money._";
	code =
		if (coins_amount() < 1000)
			rs(1);
			else {
				rs(3);
				change_coins(-1000);
				sf(8,17,1);
				}
	break;

begintalknode;
	state = 804;
	nextstate = 801;
	condition = gf(8,17) == 0;
	question = "_I do not want to pay that much._";
	text1 = "_Ah, well. Magical augmentation of the sort I offer is more than worth the price. But then, it is your decision._";

begintalknode;
	state = 801;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_All right. Thank you. Come again!_";
	action = END_TALK;

// Quinn

begintalknode;
	tag = 460;
	state = -1;
	nextstate = 829;
	question = "Quinn";
	text1 = "The owner of the inn is a young woman, as counted in years, but the war has left her prematurely aged. She looks very glad to see a customer. _I'm Quinn,_ she says.";
	text5 = "Quinn is all smiles, eager to please. She obviously needs the business. _Yes? Anything else? What can I get you?_";
	action = INTRO;

begintalknode;
	state = 829;
	nextstate = 830;
	question = "_What can I get here?_";
	text1 = "_I run this inn, and let me tell you, it's one trial or tribulation after another. If you care, which you don't. But look. We have a reasonably safe room for ten coins. We have rounds of beer for three coins and fine bourbon for twelve coins._";
	text2 = "_I can personally recommend the bourbon._";

begintalknode;
	state = 830;
	nextstate = 832;
	question = "_What problems have you had?_";
	text1 = "_Well, the troglos begin their raids with a volley of spells over our walls, and guess what building tends to be the first they hit! That's right. My inn. It's one continuous bother, let me tell you. Plus I only have one paying customer, Ehrenfeld._";
	text3 = "She looks quite upset. _We got really hit by the troglos a few days ago. Demolished half my rooms. They even killed Ehrenfeld, my only paying customer!_";
	code =
		if (day_reached(130,2))
			remove_string(1);
			else remove_string(3);
	break;

begintalknode;
	state = 832;
	nextstate = -1;
	question = "_Ehrenfeld?_";
	text1 = "_A pleasant enough fellow. His shop was destroyed by a troglo attack a while back. He spends most of his time sitting at the corner table working on his armor._";
	text3 = "_He was in his room resting, and a few troglo firestorms caved in the whole corner of the inn. We barely got the fire out as it was. Now, how am I supposed to run an inn with all the troglos about, killing my income!_";
	code =
		if (day_reached(130,2))
			remove_string(1);
			else remove_string(3);
	break;

begintalknode;
	state = 832;
	nextstate = -1;
	question = "_Has anything been done to stop the troglo attacks?_";
	text1 = "_I tell you, it's the people running this dump! They ..._ She stops suddenly and looks around to see who might be listening. ";
	text2 = "Worried, she says _Sorry. Forgot myself for a moment. Our leaders are very smart. Care for some bourbon? A round's only twelve gold._";

begintalknode;
	state = 829;
	nextstate = -1;
	question = "_I'll have a room._ Pay ten coins.";
	text1 = "She shows you to a room. _Oh, by the way. It's perfectly safe. But you should keep your sword nearby, just in case._ The night passes peacefully, for once, and you get a good rest.";
	action = END_TALK;	
	code =
		revive_party();
		change_coins(-5);
		relocate_char(get_pc_id(0),15,45,FALSE);
		relocate_char(get_pc_id(1),16,45,FALSE);
		relocate_char(get_pc_id(2),16,46,FALSE);
		relocate_char(get_pc_id(3),15,46,FALSE);
	break;

begintalknode;
	state = 829;
	nextstate = -1;
	question = "_Round of beer, please._ Pay two coins.";
	condition = coins_amount() >= 2;
	text1 = "She serves you some beer. It's weak and unpleasant. She says, _Sorry about the beer. It's pretty bad. My regular brewer got killed. Now the bourbon ... it's excellent!_";
	code =
		force_char_status(30000,1,20);
		change_coins(-3);
	break;

begintalknode;
	state = 829;
	nextstate = 831;
	condition = coins_amount() >= 12;
	question = "_Some bourbon, barkeep._ Pay twelve coins.";
	text1 = "She pours you several shots of strong liquor. The stuff burns even your toughened throat. She leans close to you. _By the way, I've been hearing some intriguing rumors about a certain artifact. My knowledge will only cost 100 coins._";
	code =
		force_char_status(30000,1,25);
		force_char_status(30000,3,25);
		force_char_status(30000,5,25);
		change_coins(-12);
	break;

begintalknode;
	state = 831;
	nextstate = 829;
	condition = coins_amount() >= 100;
	question = "_What rumor did you hear?_ Pay 100 coins.";
	text1 = "She gladly takes the money. _Thanks!_";
	text2 = "You've already paid. She doesn't charge you again.";
	text3 = "_There was this trooper named Masok, out of Angel's Rest, in here the other day. When drunk, I heard him mention something about a halberd, the best ever made, and how he could find it. Can't hurt to ask him about it!_";
	code =
		if (gf(147,11) == 0) {
			change_coins(-100);
			rs(2);
			}
			else rs(1);
		sf(147,11,1);
	break;

begintalknode;
	state = 831;
	nextstate = -1;
	question = "_I won't pay that much for information. Sorry._";
	text1 = "She sighs. _Can't blame me for trying. Look how difficult my life is! Well, if you'll excuse me, more to do ..._ She wanders off, cleaning as she goes.";
	action = END_TALK;

begintalknode;
	state = 829;
	nextstate = -1;
	question = "_You look exhausted._";
	text1 = "She lets out a hollow laugh. _Oh, you're a sweet talker. It's bad enough, being assaulted by troglos day and night, without strangers making fun of my looks._";
	text3 = "_Do I still? It'll be a while before we can rest again. The troglo attacks have stopped, but who knows when they'll start again?_";
	action = DEP_ON_SDF 307 8 0;

begintalknode;
	state = 829;
	nextstate = -1;
	question = "_I don't need anything._";
	text1 = "She sighs. _Typical._ She wanders off, cleaning as she goes.";
	action = END_TALK;

// Ginny

begintalknode;
	tag = 480;
	state = -1;
	nextstate = 857;
	question = "Ginny";
	text1 = "You meet a very pretty young woman, busily chopping garlic. The counter is heaped with delicious food. _I'm Ginny! Welcome to my shop._";
	text5 = "Ginny smiles and works. The counter is covered with delicious looking food. Even the least appealing food here looks fantastically delicious by Avernite standards.";
	action = INTRO;

begintalknode;
	state = 857;
	nextstate = 858;
	question = "_Your food smells delicious._";
	text1 = "She indicates the counter in front of you. _Yes and doesn't all of this look good as well? It all can be yours! I have all sorts of food for sale._ She smiles. _It's nice to have customers. It's been lonely lately._";

begintalknode;
	state = 858;
	nextstate = -1;
	question = "_How do you get quality ingredients here?_";
	text1 = "_It all comes from the docks. There are few merchants on the seas these days. When they do bring quality ingredients, I make sure to get first pick._";

begintalknode;
	state = 858;
	nextstate = 859;
	question = "_Why haven't you had many customers lately?_";
	text1 = "_With all the monsters about, the merchants I always talked to don't come through much anymore. I talk to the townspeople, but some of them are, well, ungrateful. One of them, in particular._ She looks irked as she says it.";
	text3 = "_With all the monsters about, the merchants I always talked to don't come through much anymore. Worse ingredients, worse food._";
	action = DEP_ON_SDF 9 9 1;

begintalknode;
	state = 859;
	nextstate = -1;
	condition = gf(9,9) <= 1;
	question = "_Who was ungrateful?_";
	code =
		run_hardcode(144);
	break;

begintalknode;
	state = 857;
	nextstate = 861;
	condition = gf(9,9) >= 1;
	question = "_What do you think of Sloan?_";
	text1 = "_Sloan's one of the town archers, and he's very, very good and handsome! I was fond of him. Once. But then I gave him my ring, a family heirloom, for luck, and he loses it! I really wish someone could recover my beautiful ring from that oaf._";
	text3 = "She sighs. _The oaf still hasn't been in to see me yet, now that all of this has been settled._ She pouts, then smiles again. _Oh well! It can't be too long!_";
	action = DEP_ON_SDF 9 9 1;

begintalknode;
	state = 861;
	nextstate = -1;
	condition = gf(9,9) <= 1;
	question = "_Why do you think Sloan is mean?_";
	text1 = "_I mean, he came in, apologized, said the ring was gone, and left! Just like that! And I haven't seen him since! What sort of way is that for a gentleman to act?_";

begintalknode;
	state = 857;
	nextstate = -1;
	condition = gf(9,9) == 1 && gf(9,11) >= 1;
	question = "_I think I found the ring you gave to Sloan._";
	code =
		run_hardcode(144);
	break;

begintalknode;
	state = 857;
	nextstate = -1;
	condition = gf(9,9) > 1;
	question = "_Any gossip about Sloan?_";
	code =
		run_hardcode(144);
	break;

begintalknode;
	state = 857;
	nextstate = -1;
	question = "_Can I buy some food?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Ginny's Rations","Ginny's food is good. It could be even better if merchants brought the exotic, fresh ingredients she wants. She is still doing an excellent job with what she has.",24,2,3);
	break;
	
begintalknode;
	state = 857;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_I'll be patient. You'll get hungry eventually!_";
	action = END_TALK;
	
// Ehrenfeld

begintalknode;
	tag = 500;
	state = -1;
	nextstate = 885;
	question = "Ehrenfeld";
	text1 = "A man sits at one of the inn's tables. The table has several pieces of armor on it, and the man is polishing one of them. _I'm Ehrenfeld. Have a seat._";
	text5 = "_What else do you want? These shields won't polish themselves._";
	action = INTRO;

begintalknode;
	state = 885;
	nextstate = 886;
	question = "_Why are you polishing your shield here?_";
	text1 = "_Well, my shop was destroyed in a troglo raid, so I have to run my business here for now. Care to see my wares?_";

begintalknode;
	state = 886;
	nextstate = -1;
	question = "_Sorry to hear about your store._";
	text1 = "_Those vermin! I hope we wipe them out again._ He thinks. _Oh well. I almost have the money together to rebuild my shop, and at least I have my health!_";

begintalknode;
	state = 886;
	nextstate = 887;
	question = "_Sure, but where do you keep your items?_";
	text1 = "He runs off to his hotel room, and returns shortly with a few pieces of armor. _Here we are! My shop is gone, but my goods are as high quality as ever! Care to make a purchase?_";

begintalknode;
	state = 887;
	nextstate = -1;
	question = "_I'd like to buy some of your wares._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Ehrenfeld's Armor","Ehrenfeld's shop was destroyed, but the entrepreneurial spirit lives on. He continues to sell the remnants of his stock from out of his hotel room.",79,3,3);
	break;
	
begintalknode;
	state = 887;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "You make some more small talk and move on.";
	action = END_TALK;
	
// Sean

begintalknode;
	tag = 520;
	state = -1;
	nextstate = 913;
	question = "Sean";
	text1 = "A mage stumbles into you. It's obviously been quite some time since he last slept. _Sorry. Mmrmm. I'm Sean,_ he mumbles.";
	text5 = "Sean waves gently back and forth in front of you, buffeted by the breeze. If it weren't for the occasional grunt, you would think he is asleep on his feet.";
	action = INTRO;

begintalknode;
	state = 913;
	nextstate = 914;
	question = "_Why are you so tired?_";
	text1 = "He stares off into space for a minute or so while trying to formulate an answer. Finally, he says _Must maintain the barriers._";

begintalknode;
	state = 914;
	nextstate = 915;
	question = "_Why do you have to maintain the barriers?_";
	text1 = "_Troglos keep knocking down walls. We make magic barriers to plug holes. They dispel barriers. Big pain, those dispel spells._";

begintalknode;
	state = 915;
	nextstate = 916;
	question = "_Do you know anything about how to dispel barriers?_";
	text1 = "He teeters a bit. _Dispel barriers is rare and powerful spell. Anyone knowing it can mess up our defenses. Big ... big ... hrrrr ... secret. You want to learn it?_";

begintalknode;
	state = 916;
	nextstate = -1;
	question = "_Sure._";
	text1 = "_Well, forget it. We have a book which contains it, but Mayor Knight won't let just anyone see ... Hrmmmm ..._ He almost falls over right in front of you.";
	text2 = "_Bye. Going to bed. If I can._ He stumbles off.";
	action = END_TALK;

begintalknode;
	state = 916;
	nextstate = -1;
	question = "_Not really._";
	text1 = "_That's good. Because Mayor Knight won't let... let... Hrrrr._ He almost nods off in front of you.";
	text2 = "_Got to sleep. Must sleep. Must work. Work._ He stumbles off.";
	action = END_TALK;

// Sloan

begintalknode;
	tag = 640;
	state = -1;
	nextstate = 1201;
	question = "Sloan";
	text1 = "You meet one of the Empire's archers. Empire archers are infamously well-trained and lethal, and this one is no exception. He is also depressed.";
	text2 = "_I'm Sloan,_ he says. He doesn't look pleased to have company.";
	text5 = "Sloan still looks unhappy. His bow leans against the wall next to him.";
	action = INTRO;

begintalknode;
	state = 1201;
	nextstate = 1202;
	question = "_How are you?_";
	text1 = "_I ... I ... Wait a minute! I don't have to talk to you! I have enough problems._";

begintalknode;
	state = 1202;
	nextstate = 1203;
	question = "_Tell us about your problems._";
	text1 = "_Hey! Even if I wanted to talk to you, which I don't, these days it's not too smart being seen talking to Avernites. So buzz off!_";
	text3 = "_Look, I really appreciate what you did with the ring and all. It's just that I don't think it's safe or prudent for me, an Empire soldier, to be seen talking to Avernites. Sorry. It's just the way it is._";
	action = DEP_ON_SDF 9 9 1;

begintalknode;
	state = 1203;
	nextstate = -1;
	question = "_How do you know I'm from Avernum?_";
	text1 = "_You would stick out in any crowd. Everyone knows there's Avernites about, and everyone knows about you in particular. If the Empire ever sent representatives down here anymore, you'd be arrested for sure!_";
	text2 = "_But for now, I don't want to be seen talking to you. It's not safe. Good day!_ He tromps off.";
	action = END_TALK;

begintalknode;
	state = 1201;
	nextstate = -1;
	condition = gf(9,9) == 1 && gf(9,11) <= 0;
	question = "_I was talking to Ginny. She wants her ring back._";
	code =
		run_hardcode(145);
	break;

begintalknode;
	state = 1201;
	nextstate = -1;
	condition = gf(9,9) == 2;
	question = "_I returned Ginny's ring to her._";
	code =
		run_hardcode(145);
	break;

begintalknode;
	state = 1201;
	nextstate = -1;
	condition = gf(9,9) == 1 && gf(9,11) >= 1;
	question = "_I found Ginny's ring._";
	code =
		run_hardcode(145);
	break;

begintalknode;
	state = 1201;
	nextstate = -1;
	condition = gf(9,9) >= 2;
	question = "_How are things going with Ginny?_";
	text1 = "_I ... they're ... slow. Slow, OK? I still shouldn't be seen with you. I'm an Empire soldier!_ He moves away from you very quickly.";
	action = END_TALK;

// Sloan

begintalknode;
	tag = 660;
	state = -1;
	nextstate = 1229;
	question = "Sloan";
	text1 = "You meet one of the Empire's elite archers. They are reputed to be able to put an arrow into anything, at any distance. The only thing this fellow wants an arrow put into is himself. _I'm Sloan,_ he says, barely seeming to notice you.";
	text5 = "You meet Sloan again. He looks very upset.";
	action = INTRO;

begintalknode;
	state = 1229;
	nextstate = 1230;
	question = "_Are you all right?_";
	text1 = "_It doesn't matter._";

begintalknode;
	state = 1230;
	nextstate = 1231;
	question = "_What is wrong?_";
	text1 = "_I ... I ..._ He turns to look at you, and starts to speak in an increasingly shrill voice. _Avernites probably think we Empire people are just mindless clods, eh? Well, the troglos just killed my ..._ He takes a moment to regain control.";

begintalknode;
	state = 1231;
	nextstate = 1232;
	question = "_Who got killed?_";
	text1 = "_There was a woman I loved. I lost something she owned. It drove us apart. Before anything could be done, she died in a raid. I've heard of you. I have a request._";

begintalknode;
	state = 1232;
	nextstate = -1;
	question = "_What's your request?_";
	text1 = "_The Empire's abandoned us. Our leaders are fools. You're the only people who've done anything about the monsters! Everyone knows it!_";
	text2 = "_I want the troglos dead, you hear me! Every last one of them! Dead! Do for us what you've done for others! Kill them all!_ The last part comes out in a scream. People start to stare. Embarrassed, he turns away.";
	action = END_TALK;

// NAJIB in auxdialogue
// Shahpur in auxdialogue

// Starcap

begintalknode;
	tag = 720;
	state = -1;
	nextstate = 1313;
	question = "Starcap";
	text1 = "A man, small, wiry, muscular, and leather-clad, is looking you over. His opinion of you seems to be worsening by the moment. _I'm Starcap. I hope you aren't here to waste my time._";
	text5 = "Starcap stares at you dubiously. Every time you move or speak, he acts like he thinks less of you.";
	action = INTRO;

begintalknode;
	state = 1313;
	nextstate = 1314;
	question = "_What profession are you in?_";
	text1 = "_I spend my life educating suck-weasels like you. Fulfilling? I think not._";

begintalknode;
	state = 1314;
	nextstate = -1;
	question = "_A suck-weasel?_";
	text1 = "_Yeah. Haven't you ever been called a suck-weasel before?_ You don't think so.";

begintalknode;
	state = 1314;
	nextstate = -1;
	question = "_There are worse jobs._";
	text1 = "_How could any job that involves constant work with smelly, unkempt, manners-impaired adventurers be fulfilling?_";

begintalknode;
	state = 1314;
	nextstate = -1;
	question = "_You don't have to be so insulting._";
	text1 = "_Yes. I do. I can do better then educating cavenewts. Sorry, I mean adventurers. Like you._ He gets fed up. _Look, you want training or not?_";
	code =
		sf(8,19,1);
	break;
	
begintalknode;
	state = 1313;
	nextstate = 1315;
	question = "_Why are you so irritable?_";
	text1 = "_Well, because my time gets wasted by the incompetent. I spend my life accomplishing things and gaining knowledge. And then I either spend my time wasting it on you or having it stolen._";

begintalknode;
	state = 1315;
	nextstate = 1316;
	condition = gf(8,18) <= 1;
	question = "_Stolen?_";
	text1 = "_Many of my secrets were taught to Zang, cursed Zang, who was to be my assistant. Then the same Zang broke his oaths of secrecy and fled to the remote villages of the northwest, where he teaches my knowledge for profit._";
	text2 = "_If someone could make him stop, well, I would appreciate it. But nobody has the competence or the honor. Story of my underappreciated life._";
	action = SET_SDF 8 18 1;
	code =
		toggle_quest(60,1);
	break;
	
begintalknode;
	state = 1316;
	nextstate = -1;
	question = "_What if I stopped him?_";
	text1 = "_Then I would be very, very surprised._";

begintalknode;
	state = 1316;
	nextstate = -1;
	question = "_That is a sad tale._";
	text1 = "_I can tell you are stricken with pain deep in your soul._";

begintalknode;
	state = 1313;
	nextstate = -1;
	condition = gf(8,18) == 1 && (gf(173,11) >= 1 || gf(173,12) >= 1);
	question = "_I've done it. Zang will never reveal your secrets again._";
	code =
		run_hardcode(184);
	break;

begintalknode;
	state = 1313;
	nextstate = -1;
	condition = gf(8,18) > 1 && gf(8,19) > 0;
	question = "_I would like to be trained._";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Starcap's Training",
		  "Starcap is rude, dismissive, violent, and expensive, but he does know a lot about fighting.",
		  80,5,0);	
	break;


begintalknode;
	state = 1313;
	nextstate = -1;
	condition = gf(8,18) < 2 && gf(8,19) > 0;
	question = "_I would like to be trained._";
	text1 = "_Well, I've changed my mind! I won't train you until you prove that you're worthy._";	

begintalknode;
	state = 1313;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_I've already forgotten that you're here._";
	action = END_TALK;
	
// Kurt

begintalknode;
	tag = 740;
	state = -1;
	nextstate = 1341;
	question = "Kurt";
	text1 = "There is a scruffy sailor-type selling tickets by the dock. _Hey there, adventurer. I am Kurt._";
	text5 = "Kurt is still selling tickets by the dock. He occasionally scratches himself.";
	action = INTRO;

begintalknode;
	state = 1341;
	nextstate = 1342;
	question = "_What are the tickets for?_";
	text1 = "_They'll get you to Farport, down the coast to the south. Fifteen coins. And that's all I have to talk about._";

begintalknode;
	state = 1342;
	nextstate = 1343;
	question = "_So you have nothing to say about anything else?_";
	text1 = "_Yeah, right. Look. Everyone else may be willing to spill their guts, their innermost thoughts, to a bunch of wandering, pale, psychotically violent malcontents, but I'm not. Don't want a ticket? Buzz off._";

begintalknode;
	state = 1343;
	nextstate = -1;
	question = "_There's nothing wrong with wanting to be helpful._";
	text1 = "_Oh, yeah? I've heard about you! Barging into peoples' homes? Walking up to farmhouses? Going everywhere without anyone's say-so? And if you don't like someone, you just stab them._";
	text2 = "_You adventurers. Pfaugh! There ought to be a law. That's what I say._ He turns from you in disgust.";
	action = END_TALK;

begintalknode;
	state = 1341;
	nextstate = -1;
	condition = coins_amount() >= 15;
	question = "_I'll take a ticket._ Pay 15 coins.";
	text1 = "He peels you off some tickets. _Lovely. Go to the end of this dock, and the boat will be along shortly. Oh, and go away._";
	text5 = "You have already bought this.";
	code =
		if (gf(8,9) > 0)
			rs(1);
			else {
				rs(5);
				sf(8,9,1);
				change_coins(-15);
		break;
		
begintalknode;
	state = 1341;
	nextstate = -1;
	condition = 1;
	question = "_I don't need a ticket._";
	text1 = "_Then go force someone else to talk to you. I know you'll do it, too. It's the adventurer way! Pfaugh!_";
	action = END_TALK;

